<?php

/**
 * Radcodes - SocialEngine Module
 *
 * @category   Application_Extensions
 * @package    Badge
 * @copyright  Copyright (c) 2009-2010 Radcodes LLC (http://www.radcodes.com)
 * @license    http://www.radcodes.com/license/
 * @version    $Id$
 * @author     Vincent Van <vincent@radcodes.com>
 */

class Badge_Form_Admin_Level extends Authorization_Form_Admin_Level_Abstract {
	
	public function init() {
		parent::init ();
		
		$this->setTitle ( 'Member Level Settings' )->setDescription ( "These settings are applied on a per member level basis. Start by selecting the member level you want to modify, then adjust the settings for that level below." );
		
		$this->addElement ( 'Radio', 'view', array ('label' => 'Allow Viewing of Badges?', 'description' => 'Do you want to let members view badges? If set to no, some other settings on this page may not apply.', 'multiOptions' => array (2 => 'Yes, allow viewing of all badges, even private ones.', 1 => 'Yes, allow viewing of badges.', 0 => 'No, do not allow badges to be viewed.' ), 'value' => ($this->isModerator () ? 2 : 1) ) );
		if (! $this->isModerator ()) {
			unset ( $this->view->options [2] );
		}
		
		if (! $this->isPublic ()) {
			
			// Element: comment
			$this->addElement ( 'Radio', 'comment', array ('label' => 'Allow Commenting on Badges?', 'description' => 'Do you want to let members of this level comment on badges?', 'multiOptions' => array (2 => 'Yes, allow members to comment on all badges, including private ones.', 1 => 'Yes, allow members to comment on badges.', 0 => 'No, do not allow members to comment on badges.' ), 'value' => ($this->isModerator () ? 2 : 1) ) );
			if (! $this->isModerator ()) {
				unset ( $this->comment->options [2] );
			}
			
			$this->addElement ( 'Radio', 'request', array ('label' => 'Allow Requesting of Badges?', 'description' => 'Do you want to let members request badges? NOTE: Each badge (award - manual assignment type) may have different requirements that members must be met in order to submit a request. This setting is for activating REQUEST feature.', 'multiOptions' => array (1 => 'Yes, allow requesting of badges.', 0 => 'No, do not allow badges to be requested.' ), 'value' => ($this->isModerator () ? 2 : 1) ) );
		
		} // end isPublic()
	}

}